package com.flash.javamate;

import com.flash.javamate.handler.ChangeNameHandler;
import com.flash.javamate.utils.OperateFileUtils;

import java.io.File;

/**
 * @author sunyiming
 * @date 2018/8/21
 */
public class ChangeFileNameDemo {

    public static void main(String[] args) {
        File file = new File("D:\\学习与进步\\制作8-bit计算机\\【番外篇】electronics");
        File[] files = file.listFiles();
        OperateFileUtils.changeName(files, new ChangeNameHandler() {
            /*@Override
            public String changeName(String originName) {
                String num = originName.substring(originName.indexOf("(")+1,  originName.length() - " of 13)_.mp4".length());
                String newName = String.format("【%s】%s", num, originName);
                return newName;
            }*/

            @Override
            public String changeName(String originName) {
                return originName.substring(3);
            }
        });
    }

}
